import request from "@/utils/request";

export function getDishes(params) {
  return request({
    url: "/dish/page",
    method: "get",
    params,
  });
}

export function getDishById(id) {
  return request({
    url: `/dish/${id}`,
    method: "get",
  });
}

export function addDish(data) {
  return request({
    url: `/dish`,
    method: "post",
    data,
  });
}

export function updateDish(data) {
  return request({
    url: `/dish`,
    method: "put",
    data,
  });
}

export function batchUpdateDishStatus(ids, status) {
  return request({
    url: `/dish/status/${status}`,
    method: "post",
    params: {
      ids,
    },
  });
}

export function deleteDish(data) {
  return request({
    url: `/category`,
    method: "delete",
    data,
  });
}

export function batchDeleteDishes(ids) {
  return request({
    url: `/category`,
    method: "delete",
    params: {
      ids,
    },
  });
}
